list1: [1, 2, 3, 4, 5, 6]

panduan: true

Page({
    data: {
        list: [],
        foods: ['饺子', '煲仔饭', '沙县小吃', '泡面'],
        foodsArray: [{
                id: 11,
                name: '饺子'
            },
            {
                id: 22,
                name: '煲仔饭'
            },
            {
                id: 33,
                name: '沙县小吃'
            },
            {
                id: 44,
                name: '泡面'
            },
        ],
    },

    gaibian() {
        if (this.data.list.length == 0) {
            this.setData({
                list: [1, 2, 3, 4, 5, 6]
            })
            panduan = !panduan
        } else {
            this.setData({
                list: []
            })
            panduan = !panduan
        }
    }

})